#include<stdio.h>
#include<string.h>
#include<stdlib.h>
typedef struct stu
{
    char cz[8];
    struct stu *next;
}s1;
int main()
{
    int K,i,j;
    char s[8];
    s1 *pd,*pf,*head;
    scanf("%d%s",&K,s);
    i=1;
    while(strcmp(s,"End")!=0)
    {
        pd=(s1*)malloc(sizeof(s1));
        if(i%(K+1)==0)
            strcpy(pd->cz,s);
        else
            if(strcmp(s,"JianDao")==0)
                strcpy(pd->cz,"ChuiZi");
            else if(strcmp(s,"ChuiZi")==0)
                strcpy(pd->cz,"Bu");
            else
                strcpy(pd->cz,"JianDao");
        scanf("%s",s);
        if(i==1)
            head=pf=pd;
        else
            pf->next=pd;
            pd->next=NULL;
            pf=pd;
        i++;
    }
    for(j=1,pf=head;j<i;j++,pf=pf->next)
        printf("%s\n",pf->cz);
    return 0;
}